/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

var spj = jQuery.noConflict();
var ME  =  spc.ns("spc.system.manage");
(function($) {
    /*
     * 扩展的验证
     */
    $.extend($.fn.validatebox.defaults.rules, {  
        username: {  
            validator: function(value, param){
                var reCat = /^[a-zA-Z](\w|-|\.){1,62}[a-z0-9A-Z]$/i;
                return reCat.test(value);  
            },  
            message: '以字母开头，长度在3-64之间，只能包含字符、数字和下划线。'  
        },
        password:{
            validator: function(value, param){
                var reCat = /[^\uff00-\uffff]{6,32}$/i;
                var val =$(param[0]).val();
                if(val !=""&&val!=value){
                    return reCat.test(value);
                }else{
                    return false;
                }
            },  
            message: '长度在6-32之间非全角字符且不能与用户名相同。'
        },
        sameto:{
            validator: function(value, param){
                var val =$(param[0]).val();
                return val==value;
            },  
            message: '确认密码必须与密码相同。'
        },
        mobile:{
            validator: function(value, param){
                var reCat = /^0{0,1}(13[0-9]|15[7-9]|153|156|18[7-9])[0-9]{8}$/;
                return reCat.test(value);  
            },  
            message: '请输入正确的手机号码。'
        }
                
    });
})(spj);